package com.cloudkinto.controller.wr;

import com.cloudkinto.base.BaseController;
import com.cloudkinto.common.annotations.UserSessionRequired;
import com.cloudkinto.common.web.SingleResult;
import com.cloudkinto.service.wr.QuotationSchemeService;
import com.cloudkinto.vo.wr.trial.TrialFreightRes;
import com.cloudkinto.vo.wr.trial.TrialOmsReq;
import io.swagger.annotations.*;
import lombok.RequiredArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

@RestController
@RequiredArgsConstructor
@Api(tags = "运费试算oms模块")
@RequestMapping("/api/admin/oms/QuotationScheme")
public class TrialFreightOmsController extends BaseController {
    private final Logger logger = LoggerFactory.getLogger(TrialFreightOmsController.class);

    private final QuotationSchemeService service;




    @UserSessionRequired
    @PostMapping("/trialFreight")
    @ApiOperation(value = "oms运费试算", notes = "oms运费试算")
    @ApiResponses(@ApiResponse(code = 200, message = "", response = TrialFreightRes.class))
    public SingleResult trialFreight(@RequestBody @Validated TrialOmsReq req) {
        req.setCompanyId(getCompanyId());
        return SingleResult.success(service.omsTrialFreightFee(req));
    }
}
